import express from "express";
import { serviceConfig } from "@Tea/model"
import cookieParser from "cookie-parser"
import LoginRouter from "./router/LoginRouter";
import allRouter from "./router/allRouter";
import startSideService from "./utils/startSideService";
import path from "path";

const app = express()

// 解析cookie
app.use(cookieParser())
app.use(express.json())
//app.use(express.static(path.join(__dirname, '/public'))); 
app.use(express.static('public/file'))

app.use('/', LoginRouter)
app.use('/', allRouter)

//启动其他服务
startSideService()

app.listen(serviceConfig.port, () => {
  console.log(`service run at ${serviceConfig.port}, version is: ${serviceConfig.version}`);
})